package com.restfinder.restaurant.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

import com.restfinder.model.IEntity;
import com.restfinder.user.model.User;

@Entity
@Table(name="restaurants")
public class Restaurant implements IEntity {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue
	@Getter @Setter
	private long id;
	@Getter @Setter
	private String name;
	@Getter @Setter
	private String description;
	@Getter @Setter
	private String address;
	@Column(name="www_site")
	@Getter @Setter
	private String wwwSite;
	@Getter @Setter
	private double longitude;
	@Getter @Setter
	private double latitude;
	@ManyToMany
	@JoinTable(name="rel_users_restaurants_own",
	 joinColumns=@JoinColumn(name="restaurant_id"),
	 inverseJoinColumns=@JoinColumn(name="user_id")
	)
	@Getter @Setter
	List<User> owners;
	/*@Getter @Setter
	List<RestaurantComment> comments;*/
	

}
